#ifndef _UTIL_H_
#define _UTIL_H_
#define VERSION_STRING "1.0"

#define MIN_BOARD 2
#define MAX_BOARD 23

/* These must agree with the corresponding defines in gtp.c. */
#define EMPTY 0
#define WHITE 1
#define BLACK 2

/* Used in the final_status[] array. */
#define DEAD 0
#define ALIVE 1
#define SEKI 2
#define WHITE_TERRITORY 3
#define BLACK_TERRITORY 4
#define UNKNOWN 5

#define POS(i, j) ((i) * board_size + (j))
#define I(pos) ((pos) / board_size)
#define J(pos) ((pos) % board_size)
#define OTHER_COLOR(color) (WHITE + BLACK - (color))

extern int deltai[4];
extern int deltaj[4];
extern int multideltai[8];
extern int multideltaj[8];
extern int board_size;
extern int time_limit;
extern float komi;
extern int first[40];
extern int default_move_count;
extern bool debugMsg;
#include "patternmatcher.h"
extern PatternMatcher book;
extern bool usebook;
extern int patternlimit;
extern bool playpass;
int
pass_move(int i, int j);

int  
on_board(int i, int j);

#endif
